<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-08-28 09:26:21
 * @Description: 租户下角色分配的权限表
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-08-28 09:48:50
 * @FilePath: /qingshanERP/database/migrations/qingshanerp/2021_08_28_092621_create_tenant_priv.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTenantPriv extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tenant_priv', function (Blueprint $table) {
            $table->id();
            $table->foreignId('tenant_id')->default(0)->comment('租户id');
            $table->integer('role_id')->index('role_id')->comment('角色 ID');
            $table->integer('menu_id')->comment('菜单 ID');
            $table->string('name', 20)->comment('菜单名称');
            $table->string('url', 100)->index('url')->comment('链接 url');
            $table->string('label', 100)->index('label')->comment('权限 label');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tenant_priv');
    }
}
